UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'i/4BcZP8fyPaD3zwg11yJImJMyOfVZOvfje/IxFheb4='
WHERE
key_id = '3466146718a25fb17d1d342e30721676fe7cd2d441f13153013e4d18c737892b'
AND (
token = 'i/4BcZP8fyPaD3zwg11yJImJMyOfVZOvfje/IxFheb4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)