UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'h6Vmn73D3FzuXiZo/ZvbhoafBe9jNUBZ3uBdCRRO9Fs='
WHERE
key_id = '119d4989c8e28717626dfdaa67783937c1336223f2e233243889bf20ed6cb30c'
AND (
token = 'h6Vmn73D3FzuXiZo/ZvbhoafBe9jNUBZ3uBdCRRO9Fs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)