UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '49KFxSADVYV1wbZsKUSJO/RVSj+Rv6/QzIlpaQeBBAQ='
WHERE
key_id = 'ab0cadb78431b2530b75a4150eaeb00188283f0113af7b5ffa97474ae362209d'
AND (
token = '49KFxSADVYV1wbZsKUSJO/RVSj+Rv6/QzIlpaQeBBAQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)