UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VgkqJ26J686GtCZ0irGMjKk9qG/8jR9JzVasPWAjsrk='
WHERE
key_id = '99147f451f5fa29d56ba9b92edf909e1224b8db6d98e2d108fd387a210ccb1d8'
AND (
token = 'VgkqJ26J686GtCZ0irGMjKk9qG/8jR9JzVasPWAjsrk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)