UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MN5mUuKuBb1uJM5QV7LxTQDlGZ0ZkvdbBWNGCZw8TGA='
WHERE
key_id = 'cc91fbb5cd17700d0ac4919ef87ee8b26067bbc1e80aa151a7ce9f99f75969a3'
AND (
token = 'MN5mUuKuBb1uJM5QV7LxTQDlGZ0ZkvdbBWNGCZw8TGA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)