UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sXqCUqRYfmyTY5EZZ5E2MN5Z7qp7dtw5dmzefm58bSM=' 
WHERE 
  key_id = '6e6d05280aefdaabbe9712c05aa360aa326a8731bfee6bf3797fd0de2b3b012f' 
  AND (
    token = 'sXqCUqRYfmyTY5EZZ5E2MN5Z7qp7dtw5dmzefm58bSM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029