UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EVN28jFs7QGS6Yuy+DhXX+9rP/E5/F6HRIKWIr7sIj4=' 
WHERE 
  key_id = 'ebb6c9f08b96f7ef319097847bab05a4f85965b4af0f7e244ad46efba8029c3d' 
  AND (
    token = 'EVN28jFs7QGS6Yuy+DhXX+9rP/E5/F6HRIKWIr7sIj4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020