UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NJVa1jh39ROhNkFar5wWz5Q/Jrfl3uo3rIHRcQoH/10=' 
WHERE 
  key_id = '7b2f491c757da0c90135aa2cc731087ea6ea6efacbb9017f4ecd330c7e338e6e' 
  AND (
    token = 'NJVa1jh39ROhNkFar5wWz5Q/Jrfl3uo3rIHRcQoH/10=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029