UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'V4gFPd4jDUhhyNxfmx6ZL90njMovjUtrZuA8D22n0eM='
WHERE
key_id = '9a4d95f3c261861276e8e1561737ecdab7daf7fed96ef58c104a030cd09e52f9'
AND (
token = 'V4gFPd4jDUhhyNxfmx6ZL90njMovjUtrZuA8D22n0eM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)