UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8MsFLsAPgaiHBUuCyAZiuVAWjDzHBoiv+HbxgDeufAo=' 
WHERE 
  key_id = '7dace6d124117962b323e87cca011fc5663346a2e43d8c857ca2a905ef3b9e9d' 
  AND (
    token = '8MsFLsAPgaiHBUuCyAZiuVAWjDzHBoiv+HbxgDeufAo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030