UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KPSR/3xQQmaFrK4Fi9/pkP245B5yD2g4EWwTwIASdr0='
WHERE
key_id = '1435dc782b26b54cbddfd4e02dd550d3794d3c75b891ba4ab2859a42da46f18f'
AND (
token = 'KPSR/3xQQmaFrK4Fi9/pkP245B5yD2g4EWwTwIASdr0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)