UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jXcENBEln+U5DAGB4bWJgKNmIhg2PvvD37JnVsVZPoI=' 
WHERE 
  key_id = '75ac0461133df86830b5b8e1fd16e0ce4556add1f9766c17a170f27d423f7917' 
  AND (
    token = 'jXcENBEln+U5DAGB4bWJgKNmIhg2PvvD37JnVsVZPoI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015