UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'S3fpei/pEAdRipFpTOVtICWGF34BcHzmOEBaNS+1xtY=' 
WHERE 
  key_id = 'a30f62ff6fb823c220dd641f3adafb768a97c3c35014e6883b11c6f92fbc246a' 
  AND (
    token = 'S3fpei/pEAdRipFpTOVtICWGF34BcHzmOEBaNS+1xtY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049