UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'l904bkWafVL83qAglcjpVYjqzRzO8ODoxFmLLOccAR4='
WHERE
key_id = '95e11b1c5a411601f8b27eeb09d0955e4caaca74e62b43252685576412c0d8ad'
AND (
token = 'l904bkWafVL83qAglcjpVYjqzRzO8ODoxFmLLOccAR4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)