UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'y0/CIiyKAfFs/q7SrrbbhnTQPtGtcGxqcBTQbf88kx4='
WHERE
key_id = '40fde0f23a039b5a3d9e4ec19e5f6405595a1bf0b554e5ef975d819bbc3197a3'
AND (
token = 'y0/CIiyKAfFs/q7SrrbbhnTQPtGtcGxqcBTQbf88kx4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)