UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FFXFI8wGr5xJiOs0qV2Zy/I0ZvS/7q6ADceg5pnEX5E='
WHERE
key_id = '7d5bc9d4d2013774929cd64e346681389b4e4a6eb886ec0e7954a4d93be267a2'
AND (
token = 'FFXFI8wGr5xJiOs0qV2Zy/I0ZvS/7q6ADceg5pnEX5E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)