UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/vRMJLdeJfbd6WeLkknRABbNKKMtk0dusFIr/hHUeoo=' 
WHERE 
  key_id = 'e2fc90310107dc32eac48198c67ad7f88cd10d243609c147aeff132b2fd15b9a' 
  AND (
    token = '/vRMJLdeJfbd6WeLkknRABbNKKMtk0dusFIr/hHUeoo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038