UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EnI3x+vXaft05NQlN0ksl6MI6LW/U88UvFdwqD5uJx4='
WHERE
key_id = '70065b830e92ae96c510536c5ba65ca5518d09f54de5ff5a9b1f6b17467df87b'
AND (
token = 'EnI3x+vXaft05NQlN0ksl6MI6LW/U88UvFdwqD5uJx4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)