UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HpuxQa6dYzhOfUbmW86Z1WIvizSkOcYHYpuaSqqNo70='
WHERE
key_id = '004191e5a5017d12a8ddd4061a578e180dc858697500709e2a8cba906204fd8c'
AND (
token = 'HpuxQa6dYzhOfUbmW86Z1WIvizSkOcYHYpuaSqqNo70='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)