UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2MkcRudqG5obXQCnx1eWxk7ush06c6QahYe0kw6C12g=' 
WHERE 
  key_id = '8189231057d5455108f1dc7064a45e18ed54f6c0d12da64079da01b81d243e2c' 
  AND (
    token = '2MkcRudqG5obXQCnx1eWxk7ush06c6QahYe0kw6C12g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054