UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Rk0Z4nSgfnhqsdYt2BbCQqUru4XJjP59Z9IXJUKkUGc=' 
WHERE 
  key_id = '5a20b1dc1798f570d16c694fb075551e48549f1da2e2680a25ad94c262311fd5' 
  AND (
    token = 'Rk0Z4nSgfnhqsdYt2BbCQqUru4XJjP59Z9IXJUKkUGc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032