UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2plmNOmMta6InAiWikPpLcIJTgI5PdAGd/W8ca+lFLM='
WHERE
key_id = '96462d240f46b0e965c5a99e2ccc1e14499732a3a5e0f61d445ad53e98c2d41a'
AND (
token = '2plmNOmMta6InAiWikPpLcIJTgI5PdAGd/W8ca+lFLM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)