UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'M6doRVgKbhRcVOnqiIu9wo8gNZPOM8Iqbs2Ya1hqkPU=' 
WHERE 
  key_id = 'fd0bcbe86aa6e0373edc752dc92754ac4d297c222a8b6bc1fafa23df60af6e48' 
  AND (
    token = 'M6doRVgKbhRcVOnqiIu9wo8gNZPOM8Iqbs2Ya1hqkPU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028