UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EJasQyArItV6dr9rQNHL+9bGNnQNQjY4JKo8e42E9Us=' 
WHERE 
  key_id = '23fd587e2012cdcd7ee5d81996e3209ceb267128f71f8e592de6e951e4cccf00' 
  AND (
    token = 'EJasQyArItV6dr9rQNHL+9bGNnQNQjY4JKo8e42E9Us=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023