UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3mFjoEPzOGejLWZMPw8bIVmZmckboeLrm0jd1Bz4DBc='
WHERE
key_id = '62401086304fafedd2b565a407b2aa22a8ef83761d336b94a690ed348d1915d5'
AND (
token = '3mFjoEPzOGejLWZMPw8bIVmZmckboeLrm0jd1Bz4DBc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)