UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'etVBp2mPqBYuTQs/9bv+bDLqucQ8IJDyGJBpy1sMzfc=' 
WHERE 
  key_id = '809ee270d64b3f39d448182119f6d46c2f30099d6531a6d9ad6b08979762fc81' 
  AND (
    token = 'etVBp2mPqBYuTQs/9bv+bDLqucQ8IJDyGJBpy1sMzfc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00060