UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Prtl/cBIINoPeE+7z64HqqJDtrOS5D7nRYKubzKy1yA=' 
WHERE 
  key_id = 'fb5c764735096e94238b317ea4e23ef87310ff731924341768d8c8b1b304f487' 
  AND (
    token = 'Prtl/cBIINoPeE+7z64HqqJDtrOS5D7nRYKubzKy1yA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035