UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lccUBt0AZxmTvzdFwi/FPFeOgP7BRm22KUWgSlknodY='
WHERE
key_id = '0ac5ccdf529f87c111d088e6824db02a0f1dc96b9653af9a35ef0ec9d3fb9b76'
AND (
token = 'lccUBt0AZxmTvzdFwi/FPFeOgP7BRm22KUWgSlknodY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)