UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2H8fimMc9bA6S614Kfc8PzNR2MqeLFfUFFScnAxtaEc=' 
WHERE 
  key_id = '0deeb8b49645841c278cdb9cccc2886c56138a334cf76f44dee9e167371d2819' 
  AND (
    token = '2H8fimMc9bA6S614Kfc8PzNR2MqeLFfUFFScnAxtaEc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00014