UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'C1VNnraHzgevo31wMaH7uR0GmJOW6jNAnRHReY552Ms=' 
WHERE 
  key_id = 'fc48557c4ff1bc804e8642b8fdb7f1ff818711babfe64dc806e94079321333f9' 
  AND (
    token = 'C1VNnraHzgevo31wMaH7uR0GmJOW6jNAnRHReY552Ms=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018