UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GIzDKMqWH8v//gkbJoK1C2lgWcJWHgQq/znQ6HDW4/U='
WHERE
key_id = '0fa16556bcbee941280438c78e6491a9d382ccd757b6b0d44f9eafcd98535f6c'
AND (
token = 'GIzDKMqWH8v//gkbJoK1C2lgWcJWHgQq/znQ6HDW4/U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)