UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MigUlCCZiW8trRvbRQowK+6shWFBs5S6PlOejwP+C80=' 
WHERE 
  key_id = '6bba7bb4784eace05e62f2515313d264042f24566d2ddc1adb86ac09b3ec7f52' 
  AND (
    token = 'MigUlCCZiW8trRvbRQowK+6shWFBs5S6PlOejwP+C80=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033