UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oCnbv4PuCooO+VSzX7IRx64qFcc2QYdgkT6ATadybwg='
WHERE
key_id = '948ba423483503055de15e4f8fa37ed01e96c8aeec4c16e270f7ae91df0c8927'
AND (
token = 'oCnbv4PuCooO+VSzX7IRx64qFcc2QYdgkT6ATadybwg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)