UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '43o1uuDygPKgQTVtjeR7FVcymuf2W5ZVHfsSJMCA2Eo=' 
WHERE 
  key_id = '19d5a79a42717ec37cf3848aa49b1ab491fde9f2e36ff1b24028332e7b968572' 
  AND (
    token = '43o1uuDygPKgQTVtjeR7FVcymuf2W5ZVHfsSJMCA2Eo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042