UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Tiq6wqaWMr1rL5lBvnGhJ32HhpO3I+I9OdSKeD5BN48=' 
WHERE 
  key_id = '9de99b0d15b2b428f842cf4f956fa7b6204e486b9a3d1bfc98aa2c9b98f0bf08' 
  AND (
    token = 'Tiq6wqaWMr1rL5lBvnGhJ32HhpO3I+I9OdSKeD5BN48=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038