UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FTfWwChGUW381dPFTbPnUCnwLE3WROutT6CsWXGep4I=' 
WHERE 
  key_id = 'd084fb60e5a2b23f678a034d55b0c93c8c2b765a331fb1cb3349e05da53f1af0' 
  AND (
    token = 'FTfWwChGUW381dPFTbPnUCnwLE3WROutT6CsWXGep4I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018