UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JTIB3gsh0LNEeV4ku7C+/iCG6zVOfWy/kJGH1JizXIg='
WHERE
key_id = '7f733a8f69404eb266616534d26df645490cf7a9ede420bc0cd91a965dcbf288'
AND (
token = 'JTIB3gsh0LNEeV4ku7C+/iCG6zVOfWy/kJGH1JizXIg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)