UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3vpgiadhuQ3oMfM1fuUgChjwB67s+e+SDB61u8jDwGw=' 
WHERE 
  key_id = '8279d8b63d264417c2844eed999542142142bdb72d30f6fc43f4c7ef23d5699b' 
  AND (
    token = '3vpgiadhuQ3oMfM1fuUgChjwB67s+e+SDB61u8jDwGw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024