UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/NoYCtT8NS2MjZm1PGhPV1+J/oiXqDrgxgzNwdUVlhU=' 
WHERE 
  key_id = '5d41e187bcd0a66a162895031b3b25c88910f0c6f08ef83d06a47cf17b040124' 
  AND (
    token = '/NoYCtT8NS2MjZm1PGhPV1+J/oiXqDrgxgzNwdUVlhU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024