UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LZ0E2FovDyotngZVxiz376SG0WeiOA8mvs347g+b6ww='
WHERE
key_id = 'a62cd69d42087a265d9b440515a78c9b55aa8aba30981ee2a897e1b7884d3e7b'
AND (
token = 'LZ0E2FovDyotngZVxiz376SG0WeiOA8mvs347g+b6ww='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)