UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'G99jcW45y9iJRKYN9lVYHuAR3307gC4+kEIxIyGtCyg=' 
WHERE 
  key_id = '7ab01c507180f52e9c4117fe82096d2a961da0b2b7cd8a6d11eef6779ec25bd6' 
  AND (
    token = 'G99jcW45y9iJRKYN9lVYHuAR3307gC4+kEIxIyGtCyg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030