UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LGIH5vZQRokuywx1gBH9z53AscWNdyBVGrKx14O2yHo=' 
WHERE 
  key_id = '0a93890be91e0fab41da37d2db9992accba3f0c3dd90311a181da6414e3c350d' 
  AND (
    token = 'LGIH5vZQRokuywx1gBH9z53AscWNdyBVGrKx14O2yHo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023