UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'psNF6y3URIEc6WJSOOd1hqU6fGex6/RHMVK5ssEuaS8=' 
WHERE 
  key_id = '7941189a1fba70cc25429eb9f96e493bccff5bfec02f15c5b63e96e883ed41fe' 
  AND (
    token = 'psNF6y3URIEc6WJSOOd1hqU6fGex6/RHMVK5ssEuaS8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054