UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eTHHXaj4fQqV+v9KVOhmCpQazWcDTIP52BLnlQ8AHFY=' 
WHERE 
  key_id = '911e782379d50ecacdf835ac6cba274334668b3c92d049109dd165f47c1674c9' 
  AND (
    token = 'eTHHXaj4fQqV+v9KVOhmCpQazWcDTIP52BLnlQ8AHFY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035