UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YVDbM8kjiMq93EDyniGUxAdrEwyKy78Ei/qY9K0TDr4=' 
WHERE 
  key_id = 'cb08b6f56334d41362e178f20455f6299bc97bd1f6cb2102c3cce9a359aa0e79' 
  AND (
    token = 'YVDbM8kjiMq93EDyniGUxAdrEwyKy78Ei/qY9K0TDr4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030