UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mcoCKIF7UzMe7Njl3ju7jTDBA6BI5EuS1OIJkV62Cco=' 
WHERE 
  key_id = '76eef93daf287de4df5a0564d5e8fa9c98e115c1c21fd74ed1ce075a9630e411' 
  AND (
    token = 'mcoCKIF7UzMe7Njl3ju7jTDBA6BI5EuS1OIJkV62Cco=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018