UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ceHq/PtFgttnFnHbHceWxuyW2em/b68IqF5AWuRHlZM='
WHERE
key_id = '1d474685f0429f3b4a5ce08a21be4e9d11b026d50da242858bb9b2b1f703a62d'
AND (
token = 'ceHq/PtFgttnFnHbHceWxuyW2em/b68IqF5AWuRHlZM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)