UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eR0y2WyHh0Eh5InlIpp/1aojSFeiq6jTF8unLB6joPY='
WHERE
key_id = 'c4cc1761220c67cc43b3d44febdab3b331c8ceec2b8964d5619e11b83588342a'
AND (
token = 'eR0y2WyHh0Eh5InlIpp/1aojSFeiq6jTF8unLB6joPY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)