UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8PZbSZawLcQTeNdf8CPnWmsxIUXDOVRBKttFOLfihYU=' 
WHERE 
  key_id = '2bb6cb3ee678003d85123cca26794248de79cdb9eba86e2c126c57838892336a' 
  AND (
    token = '8PZbSZawLcQTeNdf8CPnWmsxIUXDOVRBKttFOLfihYU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023