UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ts5UTxcYR/T+KfIuo7XCZp/q7J2v/DlSyfGxXf2sGac='
WHERE
key_id = '6f0dde5d94fec7e1a781e94bc2a90a971d0f754549571d032e0a30075024ed7d'
AND (
token = 'Ts5UTxcYR/T+KfIuo7XCZp/q7J2v/DlSyfGxXf2sGac='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)