UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MTQoAwQ6NkVNxS9RB7a/84SmKI+GL8iRpehUz9KqRGA=' 
WHERE 
  key_id = 'bc33f4cf9e3ebbec6c5053e3f6b2d89972186378409c18d239a1404709cc2c4e' 
  AND (
    token = 'MTQoAwQ6NkVNxS9RB7a/84SmKI+GL8iRpehUz9KqRGA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024