UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '05Q9nXRGdp4XjRsfwJp/XQzTzM8tWeZTVxlHazawpJI='
WHERE
key_id = 'a13cbe283848cbbf2362a4fadc15de808df27afbd53b571ba7716377b5069181'
AND (
token = '05Q9nXRGdp4XjRsfwJp/XQzTzM8tWeZTVxlHazawpJI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)