UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zvsrfysV+kjj6KtaaNfswindAben8QdydStOfBitu/Q=' 
WHERE 
  key_id = '09db1b294b9ba9433eab7371a528746a77dd677fec96f9321315dbd67ab2bc3b' 
  AND (
    token = 'zvsrfysV+kjj6KtaaNfswindAben8QdydStOfBitu/Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038