UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'f9xqz60Q1CxO0sBIDBF3uDhI/mOiglZg4z35PIEMBtM=' 
WHERE 
  key_id = '5c4954917927a33afd3af7a6087aeb837e40e6ed3a7817130bfe50dd05e1d244' 
  AND (
    token = 'f9xqz60Q1CxO0sBIDBF3uDhI/mOiglZg4z35PIEMBtM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035