UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ksWhe/BIspJ14aq6rxPPeFVia4myYeYG185k396R4Vs='
WHERE
key_id = '2dc0ef2bfb4e807e786fc301e25a8f03355a385e96983e6467b4d8bb699ea8f5'
AND (
token = 'ksWhe/BIspJ14aq6rxPPeFVia4myYeYG185k396R4Vs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)